Api.AddVariable 方法

新增一個使用者定義變數。

命名空間IntervalZero.KINGSTAR.Local.Api

組合: IntervalZero.KINGSTAR.Local.Api (於 IntervalZero.KINGSTAR.Local.dll) 版本:4.4.0.0

語法

C#VB
public KsReturn<UserVariable> AddVariable(
       string Name,
       KsLogDataType Type,
       UserVariable Parent = null,
       long FolderSize = 0
)
Public Function AddVariable(
       Name As String,
       Type As KsLogDataType,
       Parent = null As UserVariable,
       Long As FolderSize = 0
) As KsReturn(Of UserVariable)

參數

Name

型別:string

變數名稱。

 

Type

型別:KsLogDataType

變數的資料型別。

 

Parent

型別:UserVariable

預設值:null

UserVariable 的父資料夾,預設會將變數加到根資料夾中。

 

FolderSize

型別:long

預設值:0

新增 logDirectory 變數後,您可使用 FolderSize 設定資料夾大小。預設最多可新增 64 個 UserVariable。

回傳值

型別:KsReturn<UserVariable>

回傳一個 KsError 代碼及一個使用者定義變數。

備註

可用的 EtherCAT 狀態

ecatOffline, ecatInit, ecatBoot, ecatPreOP, ecatSafeOP, ecatOP

範例

C#
N/A

參見

Api 類別

IntervalZero.KINGSTAR.Local.Api 命名空間